<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" />
    <title>Hello React!</title>
    <script src="https://cdn.bootcss.com/react/15.4.2/react.min.js"></script>
    <script src="https://cdn.bootcss.com/react/15.4.2/react-dom.min.js"></script>
    <script src="https://cdn.bootcss.com/babel-standalone/6.22.1/babel.min.js"></script>
</head>
<body>
<div id="example"></div>
<script type="text/babel">
    var Website = React.createClass({
        getInitialState: function(){
            return {
                name:"菜鸟教程",
                site:"http://www.runoob.com"
            };
        },
        render: function(){
            return (
                <div>
                    <Name name = {this.state.name}></Name>
                    <Link site = {this.state.site}/>
                </div>
            );
        }
    });
    var Name = React.createClass({
        render: function(){
            return (
                <h1>{this.props.name}</h1>
            );
        }
    });

    var Link = React.createClass({
         render: function(){
             return(
                     <a href={this.props.site}>{this.props.site}</a>
             );
         }
    });
    ReactDOM.render(
        <Website />,
        document.getElementById('example')
    );
</script>
</body>
</html>